package com.example.controller;


import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@Slf4j
public class UserController {

    @Value("${server.port}")
    private int port;

    @Value("${my.name}")
    private String myName;

    //这种写法就是我以当前这个类，匹配到我这个包的级别作为我的打印级别
    //private static final Logger log = LoggerFactory.getLogger(UserController.class);

    @RequestMapping("/com/example/user")
    public String test(){
        System.out.println(port + ", " + myName);
        log.debug("logger debug");
        log.info("logger info");
        log.warn("logger warn");
        log.error("logger error");
        return "/login.html";
    }
}
